package com.mo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mo.entity.DevUser;

import com.mo.service.DevUserService;


@Controller
@RequestMapping("/devUser")
public class DevUserController {
	@Autowired
	private DevUserService  devUserService;
	
	@RequestMapping("/findAll")
	public String findUser(Model model){
		List<DevUser> devUser= devUserService.findAll();
		model.addAttribute("devUser", devUser);
		return "index.jsp";
	}

	@RequestMapping("/index.html")
	public String index(Model model){
		return "index.jsp";
	}
	
	@RequestMapping("/isLogin.html")
	public String isLogin(String name,String pass,Model model){
		List<DevUser> list= devUserService.isLogin(name,pass);
		model.addAttribute("list", list);
		if(list.size()>0){
			return "index1.jsp";
		}else{
			return "index2.jsp";
	    }
	}
	
	public DevUserService getDevUserService() {
		return devUserService;
	}


	public void setDevUserService(DevUserService devUserService) {
		this.devUserService = devUserService;
	}

	

	
	
	
	
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	

}
